# -*- coding:utf-8 -*-
"""
配置（读取配置）文件
1、数据库配置缓存，避免频繁访问数据库
2、配合变动通知，主动更新缓存 post方法
3、支持定时读取配置文件（llt配置）
4、读写锁 Successfully installed readerwriterlock==1.0.9
"""
from datetime import datetime
import time
from dateutil import tz
def time_delta(timestamp,timezone):
    tz_timezone = tz.gettz(timezone)
    now = datetime.now(tz=tz_timezone)
    datetime_1 = datetime.fromtimestamp(timestamp,tz_timezone)
    print(tz_timezone)

    appointment_year = datetime_1.year
    appointment_month = datetime_1.month
    appointment_day = datetime_1.day
    appointment_hour = datetime_1.hour
    appointment_minute = datetime_1.minute
    appointment_second = datetime_1.second
    appointment_microsecond = datetime_1.microsecond
    appointment_tzinfo = datetime_1.tzinfo
    print(appointment_year,appointment_month,appointment_day,appointment_hour,appointment_minute,appointment_second,appointment_microsecond,appointment_tzinfo)
    # datetime.datetime (year, month, day[ , hour[ , minute[ , second[ , microsecond[ , tzinfo] ] ] ] ] )
    
    # appointment_time =

if __name__ == '__main__':
    timestamp = time.time()
    # tz_sh = tz.gettz('Asia/Shanghai')
    print(timestamp)
    time_delta(timestamp,'Asia/Shanghai')